import axios from 'axios'
import store from '@/store/index'
const serve = axios.create({
  baseURL: '/api',
  timeout: 10000
})
// 配置请求拦截器（统一携带token）1.成功2.失败
serve.interceptors.request((config) => {
  // 判断有无token 取token
  if (store.getters.token) {
    // 有tokentongyizhuru
  } else {

  }
  return config
}, (error) => {
  return Promise.reject(error)
})
export default serve
